//
//  HelpScreen.m
//  AngerDragon
//
//  Created by gaotime_macbook_2 on 11-12-2.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "HelpScreen.h"
#import "MainScreen.h"

@implementation HelpScreen

 
- (void) dealloc {
	CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
	
	[super dealloc];
}

-(id) init {
	[super init];
	
	/// go back 按钮, 使用 位图字体
	CCLabelBMFont *a_p_cls_go_back_label = [CCLabelBMFont labelWithString:@"Go back" fntFile:@"font01.fnt"];
	
 	CCMenuItemLabel *a_p_cls_menu_go_back = [CCMenuItemLabel itemWithLabel:a_p_cls_go_back_label 
																									                target:self 
																																selector:@selector(HelpScreen_goBackClickCallback:)];
  //a_p_cls_menu_go_back.scale = 1.5;
	
	 
	
	
	// 组成菜单局
	CCMenu *a_p_cls_menu_list = [CCMenu menuWithItems: a_p_cls_menu_go_back, nil];  
	/// 垂直排成一排
	[a_p_cls_menu_list alignItemsInColumns:
	 [NSNumber numberWithUnsignedInt:1], nil];  
	
	/// 要想手动修改 菜单控件的坐标, 必须在布局动作完成后(alignItemsInColumns 布局动作)
	a_p_cls_menu_go_back.position = 
	ccp(a_p_cls_menu_go_back.contentSize.width - [[CCDirector sharedDirector] winSize].width / 2, 
			a_p_cls_menu_go_back.contentSize.height - [[CCDirector sharedDirector] winSize].height / 2);
	
		
	/// 
	[self addChild: a_p_cls_menu_list];
	
	
	return self;
}

/**
 * @brief 点击了 返回主菜单 按钮 
 *
 * @param[in] (id) sender
 * @param[out] nil
 *
 * @return void
 *
 * @note注解
 *
 */
-(void) HelpScreen_goBackClickCallback: (id) sender {
	CCScene *a_p_cls_main_screen_scene = [CCScene node];
	[a_p_cls_main_screen_scene addChild:[MainScreen node]];
	
	[[CCDirector sharedDirector] replaceScene:[CCTransitionSlideInL transitionWithDuration:1.2f 
																																									 scene:a_p_cls_main_screen_scene]];	
}

@end
